import { Injectable, Logger } from '@nestjs/common';
import * as chalk from 'chalk';

@Injectable()
export class StartupLoggerService {
  private readonly logger = new Logger('NestApplication');

  logApplicationStartup(host: string, port: number, localIp: string, apiDocsPath: string = 'api-docs'): void {
    this.logger.log(
      `${chalk.green('🚀')} Application is running on: ${chalk.blue(`http://${host}:${port}`)}`,
    );
    
    this.logger.log(
      `${chalk.green('📚')} Swagger UI is available at: ${chalk.blue(`http://${host}:${port}/${apiDocsPath}`)}`,
    );
    
    this.logger.log(
      `${chalk.green('🌐')} Local IP access: ${chalk.blue(`http://${localIp}:${port}`)}`,
    );
    
    this.logger.log(
      `${chalk.green('📖')} Local Swagger UI: ${chalk.blue(`http://${localIp}:${port}/${apiDocsPath}`)}`,
    );
  }
}